<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Expires" content="0">
		 <meta http-equiv="Pragma" content="no-cache">
		 <meta http-equiv="Cache-control" content="no-cache">
		 <meta http-equiv="Cache" content="no-cache">
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>异常现象及处理方法</title>
		<link rel="stylesheet" href="./layui/css/layui.css"/>
	</head>
	<body>
		<fieldset class="layui-elem-field site-demo-button">
			<legend><big><b>工程部机台维修信息收集</b></big></legend>
			<div class="layui-fluid layui-form layui-form-pane">
				<div class="layui-row layui-form-item">
					<label class="layui-form-label">扫描二维码:</label>
					<div class="layui-input-block">
						<input class="layui-input" placeholder="请扫入特定的二维码" id="qr" type="text"/>
					</div>
				</div>
				
			</div>
			
		</fieldset>
		
			<div class="layui-fluid layui-form layui-form-pane">
			<div class="layui-form-item">
				<label class="layui-form-label">工序</label>
				<div class="layui-input-block">
					<input id="radio0" type="radio" name="gongxu" value="固晶" title="固晶" lay-filter="gongxu">
					<input id="radio1" type="radio" name="gongxu" value="焊线" title="焊线" lay-filter="gongxu">
					<input id="radio2" type="radio" name="gongxu" value="点胶" title="点胶" lay-filter="gongxu">
					<input id="radio3" type="radio" name="gongxu" value="切割" title="切割" lay-filter="gongxu">
					<input id="radio4" type="radio" name="gongxu" value="分光" title="分光" lay-filter="gongxu">
					<input id="radio5" type="radio" name="gongxu" value="编带" title="编带" lay-filter="gongxu">
				</div>
		  </div>
		  </div>
		
		<fieldset class="layui-elem-field site-demo-button">
			<legend><big><b>当前信息</b></big></legend>
			<div id="DQ" class="layui-fluid layui-form layui-form-pane">
				<div class="layui-col-sm4">
						<label class="layui-form-label">作业员:</label>
						<div class="layui-input-block">
							<input class="layui-input" readonly=true placeholder="这里是当前机台" id="work_name" type="text"/>
						</div>
				</div>
				<div class="layui-col-sm4">
					<label class="layui-form-label">维修员:</label>
					<div class="layui-input-block">
						<input class="layui-input" readonly=true placeholder="这里是员工姓名" id="YGXM" type="text"/>
					</div>
				</div>
				<div class="layui-row">
					
				</div>
				<div class="layui-col-sm4">
						<label class="layui-form-label">当前机台:</label>
						<div class="layui-input-block">
							<input class="layui-input" readonly=true placeholder="这里是当前机台" id="DQJT" type="text"/>
						</div>
				</div>
				<div class="layui-col-sm4">
					<label class="layui-form-label">工单号:</label>
					<div class="layui-input-block">
						<input class="layui-input" readonly=true placeholder="工单号" id="order_id" type="text"/>
					</div>
				</div>
				
				<div class="layui-row">
					
				</div>
				<div class="layui-col-sm4">
					<label class="layui-form-label">开始时间:</label>
					<div class="layui-input-block">
						<input class="layui-input" readonly=true placeholder="开始时间" id="startime" type="text"/>
					</div>
				</div> 
				<div class="layui-col-sm4">
					<label class="layui-form-label">结束时间:</label>
					<div class="layui-input-block">
						<input class="layui-input" readonly=true placeholder="结束时间" id="endtime" type="text"/>
					</div>
				</div>
				<div class="layui-row">
					<div class="layui-col-sm4">
						<label class="layui-form-label">异常现象:</label>
						<div class="layui-input-block">
							<input class="layui-input" readonly=true placeholder="异常现象" id="YCXX" type="text"/>
						</div>
					</div>
					<div class="layui-col-sm4">
						<label class="layui-form-label">处理方法:</label>
						<div class="layui-input-block">
							<input class="layui-input" readonly=true placeholder="处理方法" id="CLFF" type="text"/>
						</div>
					</div>
				</div>
			</div>
		</fieldset>
		<fieldset class="layui-elem-field site-demo-button">
			<legend><big><b>选择处理方法</b></big></legend>
				<!-- <div class="layui-row"> -->
						<!-- <button disabled="disabled" class="layui-btn  layui-btn-radius layui-btn-normal layui-btn-disabled" id="KSSJ">开始时间</button> -->
				
				<!-- </div> -->
				
				<div class="layui-row">
					<div class="layui-form-item layui-form-text layui-col-sm8">
						<label class="layui-form-label ">处理方法过程记录</label>
						<div class="layui-input-block">
						  <textarea placeholder="请输入处理过程" class="layui-textarea" id="handle_process"></textarea>
						</div>
					</div>				
					
				</div>
				
				
				<hr  width="100%" style="height:1px;" color="#000000"/>
				
				<div class="layui-row">
					<div class="layui-form-item layui-form-text layui-col-sm8">
						<label class="layui-form-label ">处理方法</label>
						<div class="layui-input-block">
						  <textarea placeholder="可多选可自定义" class="layui-textarea" id="custom"></textarea>
						</div>
						<div>
							<button disabled="disabled" class="layui-btn  layui-btn-radius layui-btn-normal layui-btn-disabled" id="keepbutton">存储</button>
						</div>
					</div>				
					
				</div>
				<div  class="layui-btn-container" class="layui-row" id="button_box">
					
				</div>
			</div>
		</fieldset>
		<fieldset class="layui-elem-field site-demo-button">
			<legend><big><b>维修信息清单</b></big></legend>
			<div class="layui-fluid layui-form layui-form-pane">
				<div id="YC" class="layui-row"></div>
			</div>
		</fieldset>
		
		<fieldset class="layui-elem-field site-demo-button layui-btn-container">
			<legend><big><b>机台报异常列表</b></big></legend>
			<div class="layui-fluid layui-form layui-form-pane">
				<div id="YCLB" class="layui-row"></div>
			</div>
		</fieldset>
		<!-- 加载类ui文件 -->
		<script src="./layui/layui.js"></script>
		<!-- 加载jQuery文件 -->
		<script src="./js/jquery.min.js"></script>
		<script src="./jexcel-master/dist/js/jquery.jexcel.js"></script>
		<!-- 写脚本 -->
		<script>
		<!-- 程序更新后将之前单选的工序继续选上 -->
		for(var i=0;i<6;i++){
			if(localStorage.gongxu==$("#radio"+i).val()){
				$("#radio"+i).prop("checked",true);
			}
		}
			var buttonycid='';
			var gongxu='';
			var ycid=new Array();//fix表中的ycid集
			var ZiDian1 = {};//字典1
			var czycid="";
			//这里是画面准备完毕后执行的程式
			$(document).ready(function(){
				//$("#keepbutton").attr("disabled",true);
				$("#keepbutton").attr("disabled",false);//启用存储按钮
				$("#keepbutton").attr("class", 'layui-btn  layui-btn-radius layui-btn-normal');//存储按钮渲染为可用
		
				//载入layui模块
				//layer弹出层,form表单,element元素组件做分页或其他
				$("#qr").select();
				layui.use(['layer','form','element','table'], function(){
					var layer = layui.layer
						,form = layui.form
						,element = layui.element
						,table = layui.table
					;
					layer.msg('初始化正常!');
					//如果HTML5WEB存储存在,就查询,否则就弹窗提示
					
					
					//监听获取工序
					form.on('radio(gongxu)', function(data){
					//console.log(data.elem); //得到radio原始DOM对象
						console.log(data.value); //被点击的radio的value值
						gongxu = data.value;
						localStorage.gongxu = gongxu;
						//$("#YCLB").html("");
						location.reload();//变更了工序后就刷新整个画面
					});
					//function refreshDiv1
					
					if (localStorage.yggh){//如果HTML5WEB存储存在,就查询,否则就弹窗提示
						//$("#YGXM").val(localStorage.yggh);
						$.ajax({
							type:'POST',
							url:"http://172.31.3.27:84/index.php?s=/scancode/shou_jian/xm",
							data:"qrc="+localStorage.yggh,
							dataType:"text",
							success:function(sss){
								$("#YGXM").val(sss);
								layer.msg(sss + '，欢迎回来!');
								localStorage.ygxm = sss;
								$("#YGXM").val(localStorage.ygxm);
							}
						});
					}else{
						layer.msg("请先登录");
					}
					/*
					
					*/
					$.ajax({
							type:'POST',
							url:"http://172.31.3.27:84/index.php?s=/tdled/Fix/WCL",
							
							dataType:"JSON",
							success:function(sss){
								for(var k=0;k<sss['SJ'].length;k++)
								{
									var d = sss['SJ'][k]['YCID'];
									ycid[k]=d;
									console.log(d);
								}
							}
						});
					if(localStorage.gongxu){
						$.ajax({
							type:'POST',
							url:"http://172.31.3.27:84/index.php?s=/tdled/Fix",
							data:"gxx="+localStorage.gongxu+"&qrc="+localStorage.yggh,
							dataType:"JSON",
							success:function(sss){
								for(var k=0;k<sss['SJ'].length;k++)
								{
									czycid='';
									var gh = sss['SJ'][k]['YGGH'];
									var jt = sss['SJ'][k]['YiChangJiTai'];
									var gd = sss['SJ'][k]['GongDanHao'];
									var cl = sss['SJ'][k]['ChuLiGH'];
									var d = sss['SJ'][k]['YCID'];
									<!-- if (ZiDian1[d]) { -->
										<!-- ZiDian1[d] = d + '丨报修人：'+gh+'丨机台：'+jt+'丨工单：'+gd+'丨处理人：'+cl; -->
										<!-- $("#"+d).html(ZiDian1[d]); -->
										<!-- $("#"+d).attr("data-d",d);//更改数据d的内容 -->
									<!-- } -->
									for(var i=0;i<ycid.length;i++){
										if(d==ycid[i]){
											czycid='t';
										}
									
									}
									if(czycid!='t'&&cl=='')
									 {
										ZiDian1[d] = d + '丨报修人：'+gh+'丨机台：'+jt+'丨工单：'+gd+'丨处理人：'+cl;
										html = "<button id='"+d+"' class='layui-col-sm7 layui-btn layui-btn-xs layui-btn-normal' data-d='"+d+"' onclick='showyc(this)'>"+ZiDian1[d]+"</button>";
										$("#YCLB").append(html);
									}
									if (czycid!='t'&&cl!='') {
										ZiDian1[d] = d + '丨报修人：'+gh+'丨机台：'+jt+'丨工单：'+gd+'丨处理人：'+cl;
										html = "<button id='"+d+"' style='background-color: #7ED321;' class='layui-col-sm7 layui-btn layui-btn-xs layui-btn-normal' data-d='"+d+"' onclick='showyc(this)'>"+ZiDian1[d]+"</button>";
										$("#YCLB").append(html);
									}
								}
							}
						});
					}else{
						layer.msg("请选择工序");
					}
				});
				//画面准备完毕后就选择扫码输入框
				$("#qr").select();
				
				//监听指定单选框
				
				
			});
			var YCID="";
			var Str2 = "0";//取前面两个字符进行下面的判断
			var JT2 = {};//机台的字典: 存扫描的次数 i
			var DQYC = {};//存机台当前的异常, 如果异常不是当前异常就发出警告
			var i = 0;
			var button_number;
			var DQJT;//当前机台
			var name;//员工姓名
			var YiChangStartTime="";//开始时间
			var endtime;//结束时间
			var YCXX;//异常现象
			var YCCODE="";//异常编码
			var CLFF;//处理方法
			var YCT = {};
			var fix_code="";//处理代码
			var s3="";//取机台前三码
			//这里是扫描输入框的回车按下后执行的程式
			var FrontTwoString;
			$("#qr").keypress(function(e){
				//如果按下的键值是回车键13就执行以下语句
				if(e.keyCode === 13){
				console.log(gongxu);
					//扫描输入框选择
					$("#qr").select();
					//定义局部变量QRC=扫描输入框的值
					var QRC = $("#qr").val();
					FrontTwoString=(QRC.substring(0,2));//前两位
					if(FrontTwoString=="EM"){
						localStorage.yggh=QRC;
						console.log(localStorage.yggh);
						$.ajax({
							type:'POST',
							url:"http://172.31.3.27:84/index.php?s=/scancode/shou_jian/xm",
							data:"qrc="+localStorage.yggh,
							dataType:"text",
							success:function(sss){
								$("#YGXM").val(sss);
								layer.msg(sss + '，欢迎回来!');
								localStorage.ygxm = sss;
								$("#YGXM").val(localStorage.ygxm);
							}
						});
						location.reload();
					}
					if(FrontTwoString!="EM"){//扫描的内容为异常代码
						$("#button_box").html("");
						YCCODE=QRC+';'+YCCODE;
						$.ajax({
							type:'POST',
							async: false,
							url: "excep_method.php",//POST傳一個超長字串到後端
							data:"except_number="+QRC,
							dataType : "JSON",
							success: function(sss){
								layer.msg('查询成功');//,返回信息: '+sss);
								
								console.log(sss);
								
								$("#YCXX").val(sss[0]["异常现象"]+';'+$("#YCXX").val());
								button_number=sss.length;
								console.log(button_number);
								for(i=0;i<sss.length;i++){
									$("#button_box").prepend(
									
										"<div class='layui-col-sm2'>"+ 
											"<button id='"+'button'+i+"' value='"+'value'+i+"' class='layui-btn layui-btn-fluid layui-btn-radius '  onclick='showDetails(this) 'return on_del_click("+'value'+i+",this)' data-delid-qty='"+sss[i]["处理代码"]+"'>"+sss[i]["处理方法"]+
											"</button>"+	
										"</div>"
									);
									//$("#button"+i).attr("disabled", true); 
										//disabled='disabled'
									
								}
								
								//var k=$("#0b").html();
								//alert(k);
							}
						});
					
					}
					console.log($("#DQJT").val()+"-"+$("#order_id").val()+"-"+YCCODE+"-"+$("#YCXX").val());
					
					if(YCCODE!=""){//满足机台，工单号，异常现象不为空是开始按钮被取用
						$("#KSSJ").attr("disabled", false);//开始时间按钮启用
						$("#KSSJ").attr("class", 'layui-btn  layui-btn-radius layui-btn-normal layui-btn-radius');//渲染为可用状态
						
					}/*测试中先注解$("#DQJT").val()!=""&&$("#order_id").val()!=""&&&&$("#startime").val()==""
					if($("#DQJT").val()!=""&&$("#order_id").val()!=""&&YCCODE!=""&&$("#startime").val()!=""){//满足机台，工单号，异常现象不为空是开始按钮被取用
						$("#keepbutton").attr("disabled",false);//启用存储按钮
						$("#keepbutton").attr("class", 'layui-btn  layui-btn-radius layui-btn-normal');//存储按钮渲染为可用
								
						console.log(button_number);
						for(var i=0;i<button_number;i++){
							$("#button"+i).attr("disabled", false);//启用button_box组的按钮
							$("#button"+i).attr("class", 'layui-btn layui-btn-fluid layui-btn-radius');//渲染button_box组按钮为可用
						}
					}*/
					$("#qr").val("").select();
				}
				
				//$("")
			});
	
		//循环查询
		function refreshDiv1()
		{
			layer.msg('刷新中');
			if(localStorage.gongxu){
				$.ajax({
					type:'POST',
					url:"http://172.31.3.27:84/index.php?s=/tdled/Fix",
					data:"gxx="+localStorage.gongxu+"&qrc="+localStorage.yggh,
					dataType:"JSON",
					success:function(sss){
					$("#YCLB").html("");
						for(var k=0;k<sss['SJ'].length;k++)
						{
							var gh = sss['SJ'][k]['YGGH'];
							var jt = sss['SJ'][k]['YiChangJiTai'];
							var gd = sss['SJ'][k]['GongDanHao'];
							var cl = sss['SJ'][k]['ChuLiGH'];
							var d = sss['SJ'][k]['YCID'];
							for(var i=0;i<ycid.length;i++){
								if(d==ycid[i]){
									czycid='t';
								}
							
							}
							if(czycid!='t'&&cl=='')
							 {
								ZiDian1[d] = d + '丨报修人：'+gh+'丨机台：'+jt+'丨工单：'+gd+'丨处理人：'+cl;
								html = "<button id='"+d+"' class='layui-col-sm7 layui-btn layui-btn-xs layui-btn-normal' data-d='"+d+"' onclick='showyc(this)'>"+ZiDian1[d]+"</button>";
								$("#YCLB").append(html);
							}
							if (czycid!='t'&&cl!='') {
								ZiDian1[d] = d + '丨报修人：'+gh+'丨机台：'+jt+'丨工单：'+gd+'丨处理人：'+cl;
								html = "<button id='"+d+"' style='background-color: #7ED321;' class='layui-col-sm7 layui-btn layui-btn-xs layui-btn-normal' data-d='"+d+"' onclick='showyc(this)'>"+ZiDian1[d]+"</button>";
								$("#YCLB").append(html);
							}
						}
					}
				});
			}
		}
	
	/*$("#KSSJ").click(function(){//开始按钮的监听
		$("#endtime").val("");
		$("#CLFF").val("");
		$("#startime").val(GetDateStr(0));//开始时间
		
		console.log(YiChangStartTime+"-"+$("#startime").val());
		console.log(compareTime(YiChangStartTime,$("#startime").val()));
		
		console.log("&DQJT="+$("#DQJT").val()+"&name="+$("#YGXM").val()+"&except_number="+YCCODE+"&except_pho="+$("#YCXX").val()+"&startime="+$("#startime").val());
			//if(compareTime(YiChangStartTime,$("#startime").val())=='success'){
				
				$("#KSSJ").attr("disabled", true);//开始时间按钮被禁用
				$("#KSSJ").attr("class", 'layui-btn  layui-btn-radius layui-btn-normal layui-btn-disabled');//添加禁用渲染
				$("#keepbutton").attr("disabled",false);//启用存储按钮
				$("#keepbutton").attr("class", 'layui-btn  layui-btn-radius layui-btn-normal');//存储按钮渲染为可用
				for(var i=0;i<button_number;i++){
					$("#button"+i).attr("disabled", false);//启用button_box组的按钮
					$("#button"+i).attr("class", 'layui-btn layui-btn-fluid layui-btn-radius');//渲染button_box组按钮为可用
				}
				$.ajax({
					type:"POST",
					url:"starkeepfix.php",
					data:"&DQJT="+$("#DQJT").val()+"&name="+$("#YGXM").val()+"&except_number="+YCCODE+"&except_pho="+$("#YCXX").val()+"&startime="+$("#startime").val()+"&order_id="+$("#order_id").val()+"&YCID="+YCID,
					dataType:"text",
					success: function(data){
						layer.msg('保存成功');//返回信息);
						console.log(data);
					}
				});
			//}
			//else{
				//layer.msg("结束时间小于开始时间，出现异常");
				//alert("结束时间小于开始时间，出现异常");
			//}
		
	});*/
	
	$("#keepbutton").click(function(){//存储按钮监听
		$("#qr").select();
		$("#"+buttonycid).remove();//移除被选中的异常信息
		$("#endtime").val(GetDateStr(0));//结束时间
			
		$.ajax({
		//http://127.0.0.1:2121/?type=publish&to1530529489000,1530529092000=&content=wanan
			type:"publish",
			url:"http://172.31.3.21:2121/?type=publish"+"&to="+s3+"&content="+$("#DQJT").val(),
			
			dataType:"text",
			success: function(data){
				layer.msg('保存成功');//返回信息);
				console.log(data);
			}
		});	
			
			
			var k=$("#custom").val();
			$("#CLFF").val(k);
			console.log($("#YCXX").val()+"-"+YCCODE);
			if($("#custom").val()!=""){//自定义不能为空
				/*$("#KSSJ").attr("disabled", false);//开始时间按钮启用
				$("#KSSJ").attr("class", 'layui-btn  layui-btn-radius layui-btn-normal layui-btn-radius');//渲染为可用状态
				*/$("#keepbutton").attr("disabled",true);//存储按钮禁用
				$("#keepbutton").attr("class", 'layui-btn  layui-btn-radius layui-btn-normal layui-btn-disabled');//渲染
				for(var i=0;i<button_number;i++){
					$("#button"+i).attr("disabled", true);//button_box禁用
					$("#button"+i).attr("class", 'layui-btn layui-btn-fluid layui-btn-radius layui-btn-disabled');
				}
					$.ajax({
						type:"POST",
						url:"updatefix.php",
						data:"&DQJT="+$("#DQJT").val()+"&name="+$("#YGXM").val()+"&startime="+$("#startime").val()+"&endtime="+$("#endtime").val()+"&method="+k+"&except_number="+YCCODE+"&fix_code="+fix_code+"&except_pho="+$("#custom").val()+"&order_id="+$("#order_id").val()+"&handle_process="+$("#handle_process").val(),
						dataType:"text",
						success: function(data){
							layer.msg('保存成功');//返回信息);
							console.log(data);
						}
					});
				}
				else{
					layer.msg('自定义处理方法不能为空');
					//alert("处理过程和自定义处理方法不能为空");
				}
				$("#YC").append(//显示到维修信息清单中
					"<div  class='layui-col-xs6 layui-col-sm4 layui-col-md2 layui-anim-up'>"+
						"<fieldset  class='layui-elem-field layui-form layui-form-pane'>"+
							"<legend>机台号: " + $("#DQJT").val() + "</legend>"+
							"<div class='layui-field-box'>"+
								"<div>"+
									"<br/>操作员: "+ $("#YGXM").val() +
									"<br/>开始时间: "+ $("#startime").val() +
									"<br/>结束时间: " + $("#endtime").val() +
									"<br/>异常现象: "+ $("#YCXX").val() +
									"<br/>处理方法: " + k +
									
								"</div>"+
							"</div>"+
						"</fieldset>"+
					"</div>"
				);
		/*$("#DQJT").val("");
		
		$("endtime").val("");*/
		//location.reload();
	});
	
	function showDetails(del_id)
	{//自动识别button组
						
		$("#qr").select();
		k=$(del_id).html();//获取button的按键值
		
		$("#custom").append(k+';');
		console.log($("#custom").val());
		$("#CLFF").val(k+';'+$("#CLFF").val());
		$("#endtime").val(GetDateStr(0));//结束时间
		fix_code = del_id.getAttribute("data-delid-qty")+';'+fix_code;//按键对应的处理代码
		$("#del_id").hide();
		//$("#button1").remove();
		//on_del_click("aaa",del_id);
		//delete ZiDian1[ky];
		buttonid=del_id.getAttribute("id");
		console.log(fix_code+"-"+$("#CLFF").val());
		$("#"+buttonid).remove();
		console.log($("#DQJT").val()+"-"+$("#YGXM").val()+"-"+$("#startime").val()+"-"+$("#endtime").val()+"-"+$("#YCXX").val()+"-"+k+"-"+YCCODE+"-"+fix_code);
	
		/*$("#DQJT").val("");
		$("#YGXM").val("");
		$("#YCXX").val("")
		$("#startime").val("");
		$("order_id").val("");
		$("handle_process").val("");
		$("endtime").val("");*/
		//location.reload();
	}
	function showyc(del_id){
		$("#keepbutton").attr("disabled",false);//启用存储按钮
		$("#keepbutton").attr("class", 'layui-btn  layui-btn-radius layui-btn-normal');//存储按钮渲染为可用

		var k=$(del_id).html();//获取button的按键值
		$("#startime").val(GetDateStr(0));//开始时间
		buttonycid=del_id.getAttribute("id");
		information = k.split('丨');
		WOEKNAMEs=information[1].split('：');
		DQJTs=information[2].split('：');
		order_ids=information[3].split('：');
		
		$("#DQJT").val(DQJTs[1]);
		s3 = $("#DQJT").val().substr(0,3);
		$("#order_id").val(order_ids[1]);
		var d1 =information[0];
		YCID=d1;
		//SJDM = d1;
		del_id.disabled=true;//按钮禁用
		del_id.className='layui-col-sm7 layui-btn layui-btn-fluid layui-btn-xs layui-btn-normal layui-btn-disabled';//添加禁用渲染
		console.log(localStorage.yggh+"--"+d1+"--"+localStorage.gongxu);
		layer.msg("数据更新中,请稍后!");
		$.ajax({
			url:"http://172.31.3.27:84/index.php?s=/tdled/Fix/shoujian",//172.31.3.27:84//127.0.0.1:85
			data:"qrc="+localStorage.yggh+"&idd="+d1+"&gxx="+localStorage.gongxu,
			dataType:"JSON",
			success:function(sss){
			//console.log(sss);
			}
		});
		
		$.ajax({
			type:"POST",
			url:"starkeepfix.php",
			data:"&DQJT="+$("#DQJT").val()+"&name="+$("#YGXM").val()+"&except_number="+YCCODE+"&except_pho="+$("#YCXX").val()+"&startime="+$("#startime").val()+"&order_id="+$("#order_id").val()+"&YCID="+YCID,
			dataType:"text",
			success: function(data){
				layer.msg('保存成功');//返回信息);
				console.log(data);
			}
		});
		
		$.ajax({
			type:'POST',
			url:"http://172.31.3.27:84/index.php?s=/scancode/shou_jian/xm",
			data:"qrc="+WOEKNAMEs[1],
			dataType:"text",
			success:function(sss){
				$("#work_name").val(sss);
			}
		});
		
	}
			function GetDateStr(AddDayCount) {//获取时间
				var dd = new Date();
				dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
				var y = dd.getFullYear();
				var m = dd.getMonth()+1;//获取当前月份的日期
				if(m<10){
					m="0"+m;
				}
				var d = dd.getDate();
				if(d<10){
					d="0"+d;
				}
				var hh = dd.getHours();  //获取当前小时数(0-23)
				if(hh<10){
					hh="0"+hh;
				}
				var min = dd.getMinutes();
				if(min<10){
					min="0"+min;
				}
				var ss = dd.getSeconds();
				if(ss<10){
					ss="0"+ss;
				}
				return y + "-" + m + "-" + d + " " + hh + ":" + min + ":" + ss;
			}
			
			var div1Flag = setInterval(refreshDiv1, 1000*30);
				//var div1Flag = setInterval(refreshDiv2, 1000*5);
				
			
			
			function compareTime(startTime,endTime) {//时间的比较大小2018-04-24 14:59:16
			  var startTimes = startTime.substring(0, 10).split('-');
			  var endTimes = endTime.substring(0, 10).split('-');
			  startTime = startTimes[1] + '-' + startTimes[2] + '-' + startTimes[0] + ' ' + startTime.substring(10, 19);
			  endTime = endTimes[1] + '-' + endTimes[2] + '-' + endTimes[0] + ' ' + endTime.substring(10, 19);
			  console.log(startTime);
			  console.log(endTime);
			  var thisResult = (Date.parse(endTime) - Date.parse(startTime)) / 3600 / 1000;
			  console.log(thisResult);
			  if (thisResult < 0) {
				return  'exception';//结束时间小于开始时间
			  }
			  if (thisResult > 0) {
				return 'success';//结束时间大于开始时间
				//return '';
			  } 
			}
		</script>
	</body>
</html>